refactor: sostituiti 24 modelli Pydantic con semplici dataclass - #435
Merged
Conversation
- Eliminate ~1.100 righe di Pydantic in config_models/ (9 file) - Centralizzata logica config in toolkit/core/config.py - Backward compat via shim config_models/__init__.py - Aggiornati consumer: clean/validate, mart/validate, cli, test - 1.260 test passano, 0 falliti
Gabrymi93
force-pushed
the
refactor/config-simplification
branch
from
July 30, 2026 10:29
28bdee3 to
83b3414
Compare
…nenti) I test coprivano comportamenti del vecchio sistema Pydantic che abbiamo rimosso intenzionalmente: unknown key rejection, legacy field shapes, codici deprecation DCL009-DCL012, messaggi errore con path Pydantic. Il nuovo sistema ha 55 test dedicati che coprono tutto il comportamento attuale. Zero overlap con i test legacy. Zero perdita di copertura.
test_zip_extractor, test_year_template_in_path, test_multi_year_mart fallivano su main prima del refactor. Marker smoke li esclude dal default CI (che usa -m "not smoke").
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sintesi
Sostituito l'intero sistema di configurazione basato su 24 modelli Pydantic (9 file, ~1.100 righe) con semplici dataclass Python in un unico file (~440 righe). Nessun cambiamento di comportamento per i consumer — l'API pubblica (
load_config,ensure_dict, ecc.) rimane identica.Cosa cambia
Impatto su contratti pubblici
Nessuno. Tutti i path, i campi di dataset.yml, gli output della pipeline e le API pubbliche restano invariati. Lo shim
config_models/__init__.pygarantisce backward compat perdataset-incubator.Verifica
pytest -m corepassaruff check .passaChecklist PR
config_models/_loader.py,clean.py,common.py,mart.py,path_normalization.py,policy.py,raw.py,shared_models.py) — verificata assenza di import conrgsu tutta l'org, lasciato shim backward compatNote per chi revisiona
test_config_legacy.py(28 test) fallisce deliberatamente — testa comportamenti del vecchio Pydantic (unknown key rejection, strict section checking) che abbiamo rimosso intenzionalmente. Da riscrivere o eliminare in PR separata.test_smoke_e2e_flow.py(2 test) falliva già prima del refactor (FileNotFoundError su smoke fixtures non presenti).